package com.example.zuoye;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class ExamViewActivity extends AppCompatActivity {

    Button test1,test2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exam_view);
        test1=(Button)findViewById(R.id.test1);
        test2=(Button)findViewById(R.id.test2);

        test1.setOnClickListener(onClicklistener);
        test2.setOnClickListener(onClicklistener);
    }

     View.OnClickListener onClicklistener=new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             Intent intent=new Intent();
             switch (v.getId())
             {
                 case R.id.test1:
                     intent.setClass(ExamViewActivity.this,ExamActivity.class);
                     startActivity(intent);
                     break;

                 case R.id.test2:
                     Toast.makeText(ExamViewActivity.this,"该题库正在开发中，请耐心等待O(∩_∩)O",Toast.LENGTH_LONG).show();
                     break;
             }
         }
     };
}
